package priv.pront.code.mati.national.practice;


import java.io.*;

/**
 * @Author: Pronting
 * @Description:
 * @DateTime: 2023/12/1 16:39
 **/
//FIXME TLE
public class P3397_地毯 {

    static int[][] a, b;
    static StreamTokenizer st = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
    static PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) throws IOException {
        st.nextToken();
        int n = (int) st.nval;
        st.nextToken();
        int m = (int) st.nval;
        a = new int[n + 2][n + 2];
        b = new int[n + 2][n + 2];

        for (int i = 0; i < m; i++) {
            st.nextToken();
            int x1 = (int) st.nval;
            st.nextToken();
            int y1 = (int) st.nval;
            st.nextToken();
            int x2 = (int) st.nval;
            st.nextToken();
            int y2 = (int) st.nval;
            add(x1, y1, x2, y2);
        }

        out.flush();
        for (int i = 1; i <= n; i++) {
            for (int j = 1; j <= n; j++) {
                b[i][j] += b[i - 1][j] + b[i][j - 1] - b[i - 1][j - 1];
               out.print(b[i][j] + " ");
               out.flush();
            }
            out.println();
            out.flush();
        }
    }

    public static void add(int x1, int y1, int x2, int y2) {
        b[x1][y1]++;
        b[x1][y2 + 1]--;
        b[x2 + 1][y1]--;
        b[x2 + 1][y2 + 1]++;
    }
}
